from snownlp import SnowNLP
 
#情感分析
with open('ciyun.txt','r',encoding='UTF-8') as f:
	text = f.read()
 
s = SnowNLP(text)
mylist = []
# for key in s.keywords(limit=100):
# 	asd  = SnowNLP(key).sentiments
# 	mylist.append(key + '(' + str(asd) + ')')
# print(mylist)

for key in s.sentences:
	asd  = SnowNLP(key).sentiments
	mylist.append(key + '(' + str(asd) + ')')
print(mylist)

